function [qu,q,usa,qu_istc,qu_tfp,q_istc,q_tfp,cc_,q_fa,qu_fa,vd,vd_q,cc_upper_lower,sd_cc,vvv_,ADD,vd_diff,FF]=bootstrap_ISTC_news(data,rep,p,H,hor,lazy,st,rep_kil1,rep_kil2,x1,x2,m, jmcb_joint)
warning('off');
% N=10;T=200;h_=100;
 T=length(data);k=length(data(1,:));quan=0.025;
%  m=k-1;
  trend_us=0;quadr=0;
 trend_uk=trend_us;
 rest=0;% if rest=1 also piut LE=0 then you estiamte a var with nonstationary ordered first and stationary, whose number is determined by st, afterwards
%  st=3;if LE=0 and rest=0 IT ESTIMATES VAR IN FIRST DIFF (DON'T DIFFERENCE
%  DATA BEFORE ESTIMATION)
 LE=1;r1=0;r2=0;lr=0;exo=0;exo_for=0;cs=0;bayes=1;fiscal=0;kilian=0;b=2;a=3;%b-1 is number of zero restrictions;a is variable whose fev is maximized;
 
 %IN JOINT ESTIMATION a is number of shocks, x3 is ordering for first
 %variables whose fev is maximazed and x4 is ordering for the second;
 x3=1;x4=1;
%  jmcb_joint=1;
 jedc_joint=0;jie=0;
 fiscal_new=1;%fiscal_new=1 gives estimation for nonequal samples for restat referee; make sure last firm-level variable in data matrix has zeros instead of nans
 repl=100000;tot_process=0;%tot_process==1 implies bayesian estimation with exogenous block in general and of m=3 in tot paper;
H1=9;H2=1;%TRUNCATION HORIOZNS FOR TFP NEWS AND DEFENSE/IST NEWS
 %  x1=2;%x1-1 is number of zero restrictions injoint estimation of tfp new shocks (first variable)
%  x2=1;%x2-1 is number of zero restricctions in joint estimation of defense shocks/ist news (second variable)
% if jmcb_joint==1||fiscal_new==1;
% fiscal_new is not relevant: put it to zero;
%  matlabpool open 7
% end
 %  repl is number of replications in jmcb_joint estimation
 %  procedure;fiscal_new=1 for new fiscal paper with pappa;
 if kilian==1;
     kil=1;
 else
     kil=0;
 end;
%  WHEN IT'S A SMALL OPEN ECONOMY MODEL WITH rest=1 put st=number os stationary variables in domestic economy -1;
%  b-1 is number of contemporanous restrictions;a is number of variable whose fev is maximized;
%  rep_kil1=100;rep_kil2=200;( these are rep for kilian bias correction
%  bootstrap)
%  if fiscal ==1 it's pappa paer (orthogonalizes surprise defense shock with respect to ramey);
%  if LE=0 you have a VAR in first difference;quadr=1 implies quadratic
%  trend;
%  cs=1 implies that credit spread is entered in levels and then moves to the first place in VAR for the orthogonality restriction;
%  st=number of variables enetering the VAR in original form (level)
% if rest=1 we incorporate st# stationary variables in a differenced VAR; r1 is number of cointegrating vectors;
% if lazy=1 do rep=1 and get q;if lazy=0 do rep=bottdtrap replications and get bottstrap results;
 %  get;st=number of stationary variables;rest=1 means VECM;
%  bootstrap;lr=1 if we go by long restriction lr=0 else;remember that if
%  lr=1 you need to make sure that LE=0 so that variables are differenced
%  and use rest=1 to keep the statioanry variables in levels form;
%  in estimation unless ofcourse you already put them in diff form
% exo only controls no lags option for domestic variables; for foreign you
% have to use exo_for which is alomost always 0 becasue when it is 1 you
% only regress foreign variables on current domestic;

dat=zeros(T,k,rep);
if kilian==1;
    rep=rep_kil1;
    for i=1:rep;
   [dat(:,:,i),F,c_tot]=boot_us_gen_var_data(data,p,m,trend_us,rest,st,LE,r1,r2,lr,exo,exo_for,quadr,0,[],[]);
%     data(:,:,i)=[data(:,:,i) rand(T+1,1)];
    end
    COMP_MAT=F;CONS=c_tot;
else
%     rep=rep;
for i=1:rep;
   [dat(:,:,i),~,~]=boot_us_gen_var_data(data,p,m,trend_us,rest,st,LE,r1,r2,lr,exo,exo_for,quadr,kil,[],[]);
%     data(:,:,i)=[data(:,:,i) rand(T+1,1)];
end
end
if lazy==1
for i=1:rep
    dat(:,:,1)=data;
%     dat(:,:,i+1)=dat(:,:,i);
end
else dat(:,:,i)=dat(:,:,i);
end
IRF_NEWS_WORLD_=zeros(hor,k,rep);vd_=zeros(hor,k,rep);
IRF_TFP_WORLD_=zeros(hor,k,rep); IRF_istc_WORLD_=zeros(hor,k,rep);
if LE==0;
   s_news_WORLD=zeros(T-p,1,rep);s_tfp=zeros(T-p,1,rep);s_istc=zeros(T-p,1,rep);
else
s_news_WORLD=zeros(T-p+1,1,rep);s_tfp=zeros(T-p+1,1,rep);s_istc=zeros(T-p+1,1,rep);
end
for i=1:rep;
%     IRF_NEWS_WORLD_=zeros(hor,5,rep);IRF_TFP_WORLD_=zeros(hor,5,rep);s_news_WORLD=zeros(hor,T+1,rep);
 [IRF_NEWS_WORLD_(:,:,i),IRF_TFP_WORLD_(:,:,i),IRF_istc_WORLD_(:,:,i),s_news_WORLD(:,:,i),s_tfp(:,:,i),s_istc(:,:,i),usa,vd_(:,:,i),ADD,vd_istc(:,:,i),FF(:,:,i),c_tot(:,:,i)]=ISTC_NEWS(dat(:,:,i),p,H,b,a,hor,m,trend_us,trend_uk,rest,st,LE,r1,r2,lr,exo,exo_for,cs,bayes,quadr,fiscal,0,[],[],jmcb_joint,fiscal_new,repl,x1,x2,H1,H2,jedc_joint,tot_process,x3,x4,jie);
end
q=IRF_NEWS_WORLD_(:,:,1);q_istc=IRF_istc_WORLD_(:,:,1);q_tfp=IRF_TFP_WORLD_(:,:,1);
if bayes==0
conditional_cov=zeros(k,k,rep);cc=zeros(k,k,rep);
for i=1:rep
conditional_cov(:,:,i)=[IRF_NEWS_WORLD_(1,:,i);[diff(IRF_NEWS_WORLD_(:,1:end-st-1,i)) IRF_NEWS_WORLD_(2:end,end-st:end,i)]]'*[IRF_NEWS_WORLD_(1,:,i);[diff(IRF_NEWS_WORLD_(:,1:end-st-1,i)) IRF_NEWS_WORLD_(2:end,end-st:end,i)]];
cc(:,:,i)=corrcov(conditional_cov(:,:,i));
end
cc_=cc(:,:,1);
corr_data=corr([diff(data(:,1:end-st-1)) data(2:end,end-st:end)]);
cc_upper_lower=quantile(cc,[quan,1-quan],3);sd_cc=std(cc,0,3);
else
    cc_=[];cc_upper_lower=[];sd_cc=[];
end
if cs==1&&lazy==0
for i=1:rep
    if abs(IRF_TFP_WORLD_(end,3,i))<1;
      q_tfp_cs(:,:,i)=IRF_TFP_WORLD_(:,:,i);
    end
end
end
% q_fa computation for counterfactuals;v denotes order of variable on which
% the counterfactual is applied;
if fiscal==0;
v=2;
for i=1:rep
for j=1:hor-1
%     e(1,1,i)=-IRF_NEWS_WORLD_(1,v,i)./IRF_istc_WORLD_(1,v,i);
%     e(j+1,1,i)=-(IRF_NEWS_WORLD_(j+1,v,i)+IRF_istc_WORLD_(2:j+1,v,i)'*flipud(e(1:j,1,i)))./IRF_istc_WORLD_(1,v,i);
%     q_fa(j,:,i)=IRF_NEWS_WORLD_(j,:,i)+(IRF_istc_WORLD_(1:j,:,i)'*flipud(e(1:j,1,i)))';
    e(1,1,i)=-IRF_TFP_WORLD_(1,v,i)./IRF_istc_WORLD_(1,v,i);
    e(j+1,1,i)=-(IRF_TFP_WORLD_(j+1,v,i)+IRF_istc_WORLD_(2:j+1,v,i)'*flipud(e(1:j,1,i)))./IRF_istc_WORLD_(1,v,i);
    q_fa(j,:,i)=IRF_TFP_WORLD_(j,:,i)+(IRF_istc_WORLD_(1:j,:,i)'*flipud(e(1:j,1,i)))';
    end
end
else
    v=1;
for i=1:rep
for j=1:hor-1
    e(1,1,i)=-IRF_TFP_WORLD_(1,v,i)./IRF_istc_WORLD_(1,v,i);
    e(j+1,1,i)=-(IRF_TFP_WORLD_(j+1,v,i)+IRF_istc_WORLD_(2:j+1,v,i)'*flipud(e(1:j,1,i)))./IRF_istc_WORLD_(1,v,i);
    q_fa(j,:,i)=IRF_TFP_WORLD_(j,:,i)+(IRF_istc_WORLD_(1:j,:,i)'*flipud(e(1:j,1,i)))';
    end
end
end

if kilian==1;
   if max(abs(eig(COMP_MAT)))>1
  bias_corr_F=COMP_MAT;
bias_corr_C=CONS;  bias_term_F=0;bias_term_C=0;
else
FF=mean(FF,3);bias_term_F=FF-COMP_MAT;bias_corr_F=COMP_MAT-bias_term_F;
c_tot=mean(c_tot,3);bias_term_C=c_tot-CONS;bias_corr_C=CONS-bias_term_C;
if LE==1;
while max(abs(eig(bias_corr_F)))>1
   for i=1:100
       x(1,:)=1;x(i+1,:)=x(i,:)-0.01;
       bias_term_F1(:,:,1)=bias_term_F;
              bias_term_C1(:,:,1)=bias_term_C; 
      bias_term_F1(:,:,i+1)=x(i+1,:)*bias_term_F1(:,:,i);
            bias_term_C1(:,:,i+1)=x(i+1,:)*bias_term_C1(:,:,i); 
      bias_corr_F1(:,:,1)= bias_corr_F;
            bias_corr_C1(:,:,1)= bias_corr_C; 
    bias_corr_F1(:,:,i+1)=COMP_MAT-bias_term_F1(:,:,i+1);
            bias_corr_C1(:,:,i+1)=CONS-bias_term_C1(:,:,i+1);        
if abs(max(eig(bias_corr_F1(:,:,i+1))))<=1;
    bias_corr_F=bias_corr_F1(:,:,i+1);
    bias_corr_C=bias_corr_C1(:,:,i+1);
    bias_term_F=bias_term_F1(:,:,i+1);
    bias_term_C=bias_term_C1(:,:,i+1);
break
end
   end
end
else
%    while max( abs(bias_corr_F^10000))>0.0000001
    while max(abs(eig(bias_corr_F)))>1 
   for i=1:100
       x(1,:)=1;x(i+1,:)=x(i,:)-0.01;
       bias_term_F1(:,:,1)=bias_term_F;
              bias_term_C1(:,:,1)=bias_term_C; 
      bias_term_F1(:,:,i+1)=x(i+1,:)*bias_term_F1(:,:,i);
            bias_term_C1(:,:,i+1)=x(i+1,:)*bias_term_C1(:,:,i); 
      bias_corr_F1(:,:,1)= bias_corr_F;
            bias_corr_C1(:,:,1)= bias_corr_C; 
    bias_corr_F1(:,:,i+1)=COMP_MAT-bias_term_F1(:,:,i+1);
            bias_corr_C1(:,:,i+1)=CONS-bias_term_C1(:,:,i+1);        
% if abs(max(bias_corr_F1(:,:,i+1)^10000))<=0.0000001;
 if abs(max(eig(bias_corr_F1(:,:,i+1))))<=1;
    bias_corr_F=bias_corr_F1(:,:,i+1);
    bias_corr_C=bias_corr_C1(:,:,i+1);
    bias_term_F=bias_term_F1(:,:,i+1);
    bias_term_C=bias_term_C1(:,:,i+1);
break
end
   end 
   end
end
   end
rep=rep_kil2;
IRF_NEWS_WORLD_=zeros(hor,k,rep);vd_=zeros(hor,k,rep);
IRF_TFP_WORLD_=zeros(hor,k,rep); IRF_istc_WORLD_=zeros(hor,k,rep);
if LE==0;
   s_news_WORLD=zeros(T-p,1,rep);s_tfp=zeros(T-p,1,rep);s_istc=zeros(T-p,1,rep);
else
s_news_WORLD=zeros(T-p+1,1,rep);s_tfp=zeros(T-p+1,1,rep);s_istc=zeros(T-p+1,1,rep);
end
for i=1:rep;
   [dat(:,:,i),~,~]=boot_us_gen_var_data(data,p,m,trend_us,rest,st,LE,r1,r2,lr,exo,exo_for,quadr,kil,bias_corr_F,bias_corr_C);
%     data(:,:,i)=[data(:,:,i) rand(T+1,1)];
end
for i=1:rep;
%     IRF_NEWS_WORLD_=zeros(hor,5,rep);IRF_TFP_WORLD_=zeros(hor,5,rep);s_news_WORLD=zeros(hor,T+1,rep);
 [IRF_NEWS_WORLD_(:,:,i),IRF_TFP_WORLD_(:,:,i),IRF_istc_WORLD_(:,:,i),s_news_WORLD(:,:,i),s_tfp(:,:,i),s_istc(:,:,i),usa,vd_(:,:,i),ADD,vd_istc(:,:,i), FF(:,:,i),c_tot(:,:,i)]=ISTC_NEWS(dat(:,:,i),p,H,b,a,hor,m,trend_us,trend_uk,rest,st,LE,r1,r2,lr,exo,exo_for,cs,bayes,quadr,fiscal,kilian,bias_term_F,bias_term_C,jmcb_joint,fiscal_new,repl,x1,x2,H1,H2,jedc_joint,tot_process,x3,x4,jie);
end
end

FF=mean(FF,3);
qu=quantile(IRF_NEWS_WORLD_,[quan,1-quan],3);qu_istc=quantile(IRF_istc_WORLD_,[quan,1-quan],3);
qu_tfp=quantile(IRF_TFP_WORLD_,[quan,1-quan],3);
% do this for karin paper: uncomment 195-203;
% qu_istc=qu_tfp;
% for i=1:rep
%     [e in(i)]=max(IRF_TFP_WORLD_(:,2,i));
%     elas(:,:,i)=IRF_TFP_WORLD_(in(i),2,i)./IRF_TFP_WORLD_(in(i),3,i);
%     elas_(:,:,i)=repmat(elas(:,:,i),length(IRF_TFP_WORLD_(:,1,1)),length(IRF_TFP_WORLD_(1,:,1)));
% end
% quu_tfp=quantile(IRF_TFP_WORLD_,[0.01,0.99,0.05,0.95,0.1,0.9],3);
% qu_elas=quantile(elas_,[0.01,0.99,0.05,0.95,0.1,0.9],3);
% qu_tfp=cat(3,quu_tfp,qu_elas);

var_q=var(IRF_NEWS_WORLD_(:,m+1:end,:),0,3);
vv=reshape(var_q,hor*(k-m),1);vvv_=diag(vv);
if cs==1&&lazy==0
  qu_tfp=quantile(q_tfp_cs,[quan,1-quan],3);
end

qu_fa=quantile(q_fa,[quan,1-quan],3);
% vd quantile computation for FA paper;
vd=mean(vd_,3) ;vd_q=quantile(vd_,[quan,1-quan],3);
% vd_sd=std(vd_,0,3);
% FOR QUANTILE OF VD DIFFERENCE PAPA PAPER;
vd_diff=[];
% vd_diff=quantile(vd_-vd_istc,[quan,1-quan],3);
% FOR P-VALUE PAPPA PAPER;
% for i=1:rep;
%    for j=1:hor;
%        for p=1:k-1;
%            if vd_(j,p,i)-vd_istc(j,p,i)<=0;
%                vd_d(j,p,i)=1;
%            else
%                vd_d(j,p,i)=0;
%            end
%        end
%    end
% end
% vd_diff=sum(vd_d,3)./rep;

    
    
%  c = cell2mat(struct2cell(output));
%  for i=1:h_
% m(:,:,i)=mean(c(:,:,i),2);
% end
% plot([news(1:20,4),q(1:20,3,2)]);
% HALL METHOD;a=q;aa=usa.istc;
%  up=a-(qu(:,:,1)-a); low=a-(qu(:,:,2)-a);
% up_=aa-(qu_(:,:,1)-aa); low_=aa-(qu_(:,:,2)-aa);
% plot([a(1:20,5) low(1:20,5) up(1:20,5)])
% plot([a(1:20,6) low(1:20,6) up(1:20,6)])
% THE EXPANSION STUFF TAKES 10 QUARTERS FOLLOWING RECESSIONS;
% j=3;
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% s_us=[usa.shocks(:,1:2) usa.rr zeros(200,4)];
% early_1970=us(c_us,s_us,1,36,40,36,40);
% early_1980=us(c_us,s_us,1,77,79,77,79);
% early_2000=us(c_us,s_us,1,161,164,161,164);
% early_1973=us(c_us,s_us,1,52,57,52,57);
% early_1990=us(c_us,s_us,1,119,121,119,121);
% early_1982=us(c_us,s_us,1,83,88,83,88);
% early_2008=us(c_us,s_us,1,188,194,188,194);
% % 
%  s=movavg(usa.rr,4,4);
% HD FOR EFP_1953 PAPER
% j=5;
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% s_us=[usa.shocks(:,1:2) usa.rr zeros(229,4)];
% early_1957=us(c_us,s_us,1,16,19,16,19);
% early_1960=us(c_us,s_us,1,27,30,27,30);
% early_1970=us(c_us,s_us,1,65,69,65,69);
% early_1980=us(c_us,s_us,1,106,108,106,108);
% early_2000=us(c_us,s_us,1,190,193,190,193);
% early_1973=us(c_us,s_us,1,81,86,81,86);
% early_1990=us(c_us,s_us,1,148,150,148,150);
% early_1982=us(c_us,s_us,1,112,117,112,117);
% early_2008=us(c_us,s_us,1,217,223,217,223);
% FORECASTING CODE
% j=3;
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% s_us=[[usa.shocks(:,1:2);zeros(8,2)] [usa.rr;zeros(8,1)] zeros(244,4)];
% ENTIRE POSTWAR PERIOD
% j=3;
% s_us=[usa.shocks(:,1:2) usa.rr zeros(246,4)];
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% early_2008=us(c_us,s_us,1,236,242,236,242);
% early_2000=us(c_us,s_us,1,213,216,213,216);
% early_1990=us(c_us,s_us,1,167,169,167,169);
% early_1973=us(c_us,s_us,1,100,105,100,105);
% early_1957=us(c_us,s_us,1,35,38,35,38);
% early_1960=us(c_us,s_us,1,46,49,46,49);
% early_1970=us(c_us,s_us,1,84,88,84,88);
% early_1980=us(c_us,s_us,1,125,127,125,127);
% 1951-1010;
% j=3;
% s_us=[usa.shocks(:,1:2) usa.rr zeros(238,4)];
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% early_2008=us(c_us,s_us,1,224,230,224,230);
% early_2000=us(c_us,s_us,1,201,204,201,204);
% early_1990=us(c_us,s_us,1,155,157,155,157);
% early_1973=us(c_us,s_us,1,88,93,88,93);
% early_1957=us(c_us,s_us,1,23,26,23,26);
% early_1960=us(c_us,s_us,1,34,37,34,37);
% early_1970=us(c_us,s_us,1,72,76,72,76);
% early_1980=us(c_us,s_us,1,113,115,113,115);
% early_1982=us(c_us,s_us,1,119,124,119,124);
% early_1953=us(c_us,s_us,1,6,10,6,10);
% 1953-2010- 5 lags;
% j=5;
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% s_us=[usa.shocks(:,1:2) usa.rr zeros(227,4)];
% early_2008=us(c_us,s_us,1,215,221,215,221);
% early_1982=us(c_us,s_us,1,110,115,110,115);
% early_1990=us(c_us,s_us,1,146,148,146,148);
% early_1973=us(c_us,s_us,1,79,84,79,84);
% early_2000=us(c_us,s_us,1,188,191,188,191);
% early_1980=us(c_us,s_us,1,104,106,104,106);
% early_1970=us(c_us,s_us,1,63,67,63,67);
% early_1960=us(c_us,s_us,1,25,28,25,28);
% early_1957=us(c_us,s_us,1,14,17,14,17);
% 1953-2010- 5 lags and 4 less obs;
% j=5;
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% s_us=[usa.shocks(:,1:2) usa.rr zeros(223,4)];
% early_2008=us(c_us,s_us,1,211,217,211,217);
% early_1982=us(c_us,s_us,1,106,111,106,111);
% early_1990=us(c_us,s_us,1,142,144,142,144);
% early_1973=us(c_us,s_us,1,75,80,75,80);
% early_2000=us(c_us,s_us,1,184,187,184,187);
% early_1980=us(c_us,s_us,1,100,102,100,102);
% early_1970=us(c_us,s_us,1,59,63,59,63);
% early_1960=us(c_us,s_us,1,21,24,21,24);
% early_1957=us(c_us,s_us,1,10,13,10,13);
% 1951-2012;
% j=3;
% s_us=[usa.shocks(:,1:2) usa.rr zeros(241,4)];
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% early_2008=us(c_us,s_us,1,224,230,224,230);
% early_2000=us(c_us,s_us,1,197,200,197,200);
% early_1990=us(c_us,s_us,1,155,157,155,157);
% early_1973=us(c_us,s_us,1,88,93,88,93);
% early_1957=us(c_us,s_us,1,23,26,23,26);
% early_1960=us(c_us,s_us,1,34,37,34,37);
% early_1970=us(c_us,s_us,1,72,76,72,76);
% early_1980=us(c_us,s_us,1,113,115,113,115);
% early_1982=us(c_us,s_us,1,119,124,119,124);
% early_1953=us(c_us,s_us,1,6,10,6,10);
% 1959-2012;
% j=3;
% s_us=[repmat(usa.rr,7)];
% c_us=[usa.news(:,:) zeros(250,1)];
% early_2008=us(c_us,s_us,1,192,198,192,198);
% early_2000=us(c_us,s_us,1,169,172,169,172);
% early_1990=us(c_us,s_us,1,123,125,123,125);
% early_1973=us(c_us,s_us,1,88,93,88,93);
% early_1957=us(c_us,s_us,1,23,26,23,26);
% early_1960=us(c_us,s_us,1,2,5,2,5);
% early_1970=us(c_us,s_us,1,40,44,40,44);
% early_1980=us(c_us,s_us,1,81,83,81,83);
% early_1982=us(c_us,s_us,1,87,92,87,92);
% shorter pre horizon
% j=3;
% s_us=[usa.shocks(:,1:2) usa.rr zeros(241,4)];
% c_us=[usa.TFP(:,j) usa.istc(:,j) usa.news(:,j) zeros(250,4)];
% early_2008=us(c_us,s_us,217,224,230,8,14);
% early_2000=us(c_us,s_us,190,197,200,8,11);
% early_1990=us(c_us,s_us,148,155,157,8,10);
% early_1973=us(c_us,s_us,81,88,93,8,13);
% early_1957=us(c_us,s_us,16,23,26,8,11);
% early_1960=us(c_us,s_us,27,34,37,8,11);
% early_1970=us(c_us,s_us,65,72,76,8,12);
% early_1980=us(c_us,s_us,106,113,115,8,10);
% early_1982=us(c_us,s_us,112,119,124,8,13);
% early_1953=us(c_us,s_us,1,6,10,6,10);
% if jmcb==1||fiscal_new==1;
%  matlabpool close
% end
